#ifndef ___MSG_BUILDER__FOR_GATE___
#define ___MSG_BUILDER__FOR_GATE___


#include "Message/MsgBuilderIf.h"

//
//	A simple message builder with factory
//
//
class  MsgBuilderForGate : public IMsgBuilder, protected IMsgFactory
{
public:
	//
	//	serialize a message into a stream
	//
	virtual bool onEncodeMsg(IMsgRoute*  pMsgRoute, IMsg*	pMsg, MsgOStream& stream);

	//	
	//	de-serialize a message from stream
	//
	virtual bool onDecodeMsg(IMsgRoute*& pMsgRoute, IMsg*&	pMsg, MsgIStream& stream);

	//
	//	create a message base on message category and message id
	//
	IMsg*	createMsg(int nMsgCate, int nMsgID);
};


#endif

